package com.ibuildmap;

import com.facebook.react.bridge.ReadableMap;

/**
 * Created by youkai on 2017/6/7.
 */
public class Util {
    public static DataEntity getDataEntity(ReadableMap option) {
        DataEntity dataEntity = new DataEntity();
        if(option.hasKey("sysNo")){
            dataEntity.setSysNo(option.getInt("sysNo"));
        }

        if(option.hasKey("parentSysNo")){
            dataEntity.setSysNo(option.getInt("parentSysNo"));
        }

        if (option.hasKey("areaCode"))
            dataEntity.setAreaCode(option.getString("areaCode"));

        if (option.hasKey("areaName"))
            dataEntity.setAreaName(option.getString("areaName"));

        if (option.hasKey("areaType"))
            dataEntity.setAreaType(option.getInt("areaType"));

        if (option.hasKey("projectCode"))
            dataEntity.setProjectCode(option.getString("projectCode"));

        if (option.hasKey("projectName"))
            dataEntity.setProjectName(option.getString("projectName"));

        if (option.hasKey("projectCount"))
            dataEntity.setProjectCount(option.getInt("projectCount"));

        if (option.hasKey("locationY"))
            dataEntity.setLocationY(option.getDouble("locationY"));

        if (option.hasKey("locationX"))
            dataEntity.setLocationX(option.getDouble("locationX"));

        if (option.hasKey("projectLevel"))
            dataEntity.setProjectLevel(option.getInt("projectLevel"));
        return dataEntity;
    }
}
